<!--  -->
<template>
    <el-dialog class="adddialog" v-model="dialogVisible" title="选择房间" width="900" :before-close="handleClose">
       {{ ids }}
       <ELTable @multipleSelection="multipleSelection" v-bind="tableConfig"></ELTable>
    <template #footer>
      <div class="dialog-footer">
        <el-button @click="handleClose">Cancel</el-button>
        <el-button type="primary" @click="Confirm">
          Confirm
        </el-button>
      </div>
    </template>
   </el-dialog>

</template>

<script lang='ts' setup>
import { reactive,toRefs,defineProps,ref,defineEmits} from 'vue'
import ELTable,{TableType} from '../ELTable.vue';
import { getList } from '../../service/house/house';

const props=defineProps({
  buildingid:{
    type:Number
  }
})



const tableConfig:TableType={
   loadData:getList,
   searhParams:{buildingid:props.buildingid},
   columns:[
     {
      prop:"building",
      label:"楼栋号"
     },
     {
      prop:"houseno",
      label:"房间号"
     }
   ]

}
const dialogVisible=ref(true);
const emit=defineEmits(["close"]);

let ids=ref<any>([]);

const multipleSelection=(val:any[])=>{
 
  ids.value=[...val]
  

}

const handleClose=()=>{
  emit("close",[]);
}

const Confirm=()=>{
  emit("close",ids.value);
}

 
</script>
<style scoped>
</style>